package com.neuedu.thread;

public class Runner {

    public static void main(String[] args) {

        MyTicket ticket = new MyTicket();


        Thread t1 = new Thread(ticket);


        t1.setPriority(Thread.MIN_PRIORITY);
        t1.start();

        for (int i = 0;; i++) {
            System.out.println("监督员  ...  "+System.currentTimeMillis()+"\tt1isAlive\t"+t1.isAlive());
            try{
                if(i==5 ){
//                    t1.stop();
//                    t1.interrupt();
                    //设置状态,通过状态修改程序的执行星狂
                    ticket.setStop(true);

                }
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }

    }
}
